Integrand size = 34, antiderivative size = 123 \[ \int \frac {(a B+b B \cos (c+d x)) \sec ^3(c+d x)}{(a+b \cos (c+d x))^2} \, dx=-\frac {2 b^3 B \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^3 \sqrt {a-b} \sqrt {a+b} d}+\frac {\left (a^2+2 b^2\right ) B \text {arctanh}(\sin (c+d x))}{2 a^3 d}-\frac {b B \tan (c+d x)}{a^2 d}+\frac {B \sec (c+d x) \tan (c+d x)}{2 a d} \]
[Out]
Time = 0.38 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.206, Rules used = {21, 2881, 3134, 3080, 3855, 2738, 211} \[ \int \frac {(a B+b B \cos (c+d x)) \sec ^3(c+d x)}{(a+b \cos (c+d x))^2} \, dx=-\frac {2 b^3 B \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^3 d \sqrt {a-b} \sqrt {a+b}}-\frac {b B \tan (c+d x)}{a^2 d}+\frac {B \left (a^2+2 b^2\right ) \text {arctanh}(\sin (c+d x))}{2 a^3 d}+\frac {B \tan (c+d x) \sec (c+d x)}{2 a d} \]
[In]
[Out]
Rule 21
Rule 211
Rule 2738
Rule 2881
Rule 3080
Rule 3134
Rule 3855
Rubi steps \begin{align*} \text {integral}& = B \int \frac {\sec ^3(c+d x)}{a+b \cos (c+d x)} \, dx \\ & = \frac {B \sec (c+d x) \tan (c+d x)}{2 a d}+\frac {B \int \frac {\left (-2 b+a \cos (c+d x)+b \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a+b \cos (c+d x)} \, dx}{2 a} \\ & = -\frac {b B \tan (c+d x)}{a^2 d}+\frac {B \sec (c+d x) \tan (c+d x)}{2 a d}+\frac {B \int \frac {\left (a^2+2 b^2+a b \cos (c+d x)\right ) \sec (c+d x)}{a+b \cos (c+d x)} \, dx}{2 a^2} \\ & = -\frac {b B \tan (c+d x)}{a^2 d}+\frac {B \sec (c+d x) \tan (c+d x)}{2 a d}-\frac {\left (b^3 B\right ) \int \frac {1}{a+b \cos (c+d x)} \, dx}{a^3}+\frac {\left (\left (a^2+2 b^2\right ) B\right ) \int \sec (c+d x) \, dx}{2 a^3} \\ & = \frac {\left (a^2+2 b^2\right ) B \text {arctanh}(\sin (c+d x))}{2 a^3 d}-\frac {b B \tan (c+d x)}{a^2 d}+\frac {B \sec (c+d x) \tan (c+d x)}{2 a d}-\frac {\left (2 b^3 B\right ) \text {Subst}\left (\int \frac {1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a^3 d} \\ & = -\frac {2 b^3 B \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^3 \sqrt {a-b} \sqrt {a+b} d}+\frac {\left (a^2+2 b^2\right ) B \text {arctanh}(\sin (c+d x))}{2 a^3 d}-\frac {b B \tan (c+d x)}{a^2 d}+\frac {B \sec (c+d x) \tan (c+d x)}{2 a d} \\ \end{align*}
Time = 0.76 (sec) , antiderivative size = 239, normalized size of antiderivative = 1.94 \[ \int \frac {(a B+b B \cos (c+d x)) \sec ^3(c+d x)}{(a+b \cos (c+d x))^2} \, dx=\frac {B \left (\frac {8 b^3 \text {arctanh}\left (\frac {(a-b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a^2+b^2}}\right )}{\sqrt {-a^2+b^2}}-2 a^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-4 b^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+2 a^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+4 b^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {a^2}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {a^2}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-4 a b \tan (c+d x)\right )}{4 a^3 d} \]
[In]
[Out]
Time = 1.42 (sec) , antiderivative size = 194, normalized size of antiderivative = 1.58
method | result | size |
derivativedivides | \(\frac {2 B \left (-\frac {1}{4 a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {-a -2 b}{4 a^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\left (a^{2}+2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{4 a^{3}}-\frac {b^{3} \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{a^{3} \sqrt {\left (a -b \right ) \left (a +b \right )}}+\frac {1}{4 a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {-a -2 b}{4 a^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (-a^{2}-2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{4 a^{3}}\right )}{d}\) | \(194\) |
default | \(\frac {2 B \left (-\frac {1}{4 a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {-a -2 b}{4 a^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\left (a^{2}+2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{4 a^{3}}-\frac {b^{3} \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{a^{3} \sqrt {\left (a -b \right ) \left (a +b \right )}}+\frac {1}{4 a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {-a -2 b}{4 a^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (-a^{2}-2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{4 a^{3}}\right )}{d}\) | \(194\) |
risch | \(-\frac {i B \left (a \,{\mathrm e}^{3 i \left (d x +c \right )}+2 b \,{\mathrm e}^{2 i \left (d x +c \right )}-a \,{\mathrm e}^{i \left (d x +c \right )}+2 b \right )}{d \,a^{2} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{2 a d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B \,b^{2}}{a^{3} d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{2 a d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B \,b^{2}}{a^{3} d}-\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) B}{\sqrt {-a^{2}+b^{2}}\, d \,a^{3}}+\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) B}{\sqrt {-a^{2}+b^{2}}\, d \,a^{3}}\) | \(308\) |
[In]
[Out]
none
Time = 0.47 (sec) , antiderivative size = 487, normalized size of antiderivative = 3.96 \[ \int \frac {(a B+b B \cos (c+d x)) \sec ^3(c+d x)}{(a+b \cos (c+d x))^2} \, dx=\left [-\frac {2 \, \sqrt {-a^{2} + b^{2}} B b^{3} \cos \left (d x + c\right )^{2} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right ) - {\left (B a^{4} + B a^{2} b^{2} - 2 \, B b^{4}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (B a^{4} + B a^{2} b^{2} - 2 \, B b^{4}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (B a^{4} - B a^{2} b^{2} - 2 \, {\left (B a^{3} b - B a b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, {\left (a^{5} - a^{3} b^{2}\right )} d \cos \left (d x + c\right )^{2}}, -\frac {4 \, \sqrt {a^{2} - b^{2}} B b^{3} \arctan \left (-\frac {a \cos \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (d x + c\right )}\right ) \cos \left (d x + c\right )^{2} - {\left (B a^{4} + B a^{2} b^{2} - 2 \, B b^{4}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (B a^{4} + B a^{2} b^{2} - 2 \, B b^{4}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (B a^{4} - B a^{2} b^{2} - 2 \, {\left (B a^{3} b - B a b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, {\left (a^{5} - a^{3} b^{2}\right )} d \cos \left (d x + c\right )^{2}}\right ] \]
[In]
[Out]
\[ \int \frac {(a B+b B \cos (c+d x)) \sec ^3(c+d x)}{(a+b \cos (c+d x))^2} \, dx=B \int \frac {\sec ^{3}{\left (c + d x \right )}}{a + b \cos {\left (c + d x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {(a B+b B \cos (c+d x)) \sec ^3(c+d x)}{(a+b \cos (c+d x))^2} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 221 vs. \(2 (110) = 220\).
Time = 0.31 (sec) , antiderivative size = 221, normalized size of antiderivative = 1.80 \[ \int \frac {(a B+b B \cos (c+d x)) \sec ^3(c+d x)}{(a+b \cos (c+d x))^2} \, dx=-\frac {\frac {4 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )} B b^{3}}{\sqrt {a^{2} - b^{2}} a^{3}} - \frac {{\left (B a^{2} + 2 \, B b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a^{3}} + \frac {{\left (B a^{2} + 2 \, B b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a^{3}} - \frac {2 \, {\left (B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2} a^{2}}}{2 \, d} \]
[In]
[Out]
Time = 1.90 (sec) , antiderivative size = 1099, normalized size of antiderivative = 8.93 \[ \int \frac {(a B+b B \cos (c+d x)) \sec ^3(c+d x)}{(a+b \cos (c+d x))^2} \, dx=\text {Too large to display} \]
[In]
[Out]